<?php
/**
 * TomatoCMS
 *
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 *
 * @copyright    Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license        http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version     $Id: Attribute.php 2793 2010-05-03 18:48:14Z huuphuoc $
 * @since        2.0.5
 */

interface Shop_Models_Interface_Attribute
{
    /**QuanVo modified at here*/

    /**
    * Search for attribute by collection of conditions
    *
    * @param int $offset
    * @param int $count
    * @param array $exp Searching conditions. An array contain various conditions, keys including:
    * - id
    * @return Tomato_Model_RecordSet
    */
    public function find($offset, $count, $exp = null);

    /**
    * Count the number of attribute by collection of conditions
    *
    * @param array $exp Searching conditions (@see find)
    * @return int
    */
    public function count($exp = null);

    /**
    * Add new attribute
    *
    * @param Shop_Models_Attribute $attribute
    * @return int
    */
    public function add($attribute);

    /**
     * Get Attribute content by id
     * @param: $id Id of attribute content
     * @return: Tomato_Model_RecordSet
     **/
    public function getAttributeContentById($id);

    /**
     * Get Attribute by id
     * @param: $id Id of attribute
     * @return: Tomato_Model_RecordSet
     **/
    public function getAttributeById($id);

    /**
    * Update attribute
    *
    * @param Shop_Models_Attribute $attribute
    * @return void
    */
    public function update($attribute);

    /**
    * Add attribute content
    *
    * @param Shop_Models_Attribute $attribute
    * @return int
    */
    public function addContent($attribute);

    /**
    * Update attribute content
    *
    * @param Shop_Models_Attribute $attribute
    * @return void
    */
    public function updateContent($attribute);

    /**
     * Get product attribute info
     * @param: $product_id Id of product
     * @return: Tomato_Model_RecordSet
     **/
    public function getAttributeTypeByProductId($product_id);

    /**
     * Get value chain by id
     * @param: $attribute_type_id Id of Attribute ,$product_id Id of product
     * @return: Tomato_Model_RecordSet
    **/
    public function getValueTypeIdChainByAttributeTypeId($attribute_type_id,$product_id);

    /**
    * Update value chain for for relationship product and attribute
    * @param: $attribute_type_id
    * @param: $product_id
    * @param: $str_value_type_chain string all id value to update
    * @return: void
    **/
    public function updateValueTypeIdChainByAttributeTypeId($attribute_type_id,$str_value_type_chain,$product_id);

    /**
     * Count attribute of all product
     * @param int $attribute_type_id
     * @return int
    **/
    public function countAttribute($attribute_type_id);

    /**
    * Delete attribute
    *
    * @param int $id Id of attribute
    * @return void
    */
    public function delete($id);

    /**========================= Front end==================*/

    /**
     * Get attribute of product
     * @param int $id Id of product
     * @return Tomato_Model_Recordset
    **/
    public function getAttOfPro($id);

    /**
     * Get attribute by id for front end follow language
     * @param int $id Id of attribute
     * @return Tomato_Model_Recordset
    **/
    public function getFEById($id);

    /**
     * Get attribute follow language
     * @return Tomato_Model_Recordset
    **/
    public function getAllAtt();
}
